﻿<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
 
    <script type='text/html' template> 
        <input type='hidden' name='PID' value="{{ d.params.PID || '' }}"/>
    </script>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>用户名</label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='UserID' value='{{ d.params.UserID || '' }}' lay-verify='required' placeholder='用户名' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>真实姓名</label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='UserName' value='{{ d.params.UserName || '' }}' lay-verify='required' placeholder='真实姓名' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div> 
    <!-- <div class='layui-form-item'>
        <label class='layui-form-label'>用户头像</label>
        <div class='layui-input-block'>
            <script type='text/html' template lay-done='layui.data.setUpload(d);'>
                <input type='text' readonly='readonly' name='Photo_Upload' id='Photo_Upload' value='{{ d.params.Photo_Upload || '' }}' lay-verify='required' placeholder='请上传图片' autocomplete='off' class='layui-input'>
            </script>
        </div>
        <div class='layui-input-block layui-btn-container' style='width: auto;'>
            <button class='layui-btn layui-btn-primary' layadmin-event='Photo_UploadImg'>查看图片</button>
        </div>
    </div> -->
   
    <div class='layui-form-item'>
        <label class='layui-form-label'>密码</label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='PassWord' value='{{ d.params.PassWord || '' }}' lay-verify='required' placeholder='密码' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>手机号</label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='Mobile' value='{{ d.params.Mobile || '' }}' lay-verify='required' placeholder='手机号' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>     
    <!--<div class='layui-form-item'>
        <label class='layui-form-label'>用户类型 </label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <select readonly='readonly' name='UserType_Sel'>
                    <option value='0' {{ d.params.UserType_Sel == '0' ? 'selected' : '' }}>系统管理员</option>
                    <option value='1' {{ d.params.UserType_Sel == '1' ? 'selected' : '' }}>网点</option>
                    <option value='2' {{ d.params.UserType_Sel == '2' ? 'selected' : '' }}>供应商</option>
                    <option value='3' {{ d.params.UserType_Sel == '3' ? 'selected' : '' }}>会员</option>
                </select>
            </script>
        </div>
    </div>-->
       
    <div class='layui-form-item'>
        <label class='layui-form-label'>最后登录时间</label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='LastLoginTime' id='LastLoginTime' value='{{ d.params.LastLoginTime || '' }}' lay-verify='datetime' placeholder='yyyy-MM-dd HH:mm:ss' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
         
    <div class='layui-form-item'>
        <label class='layui-form-label'>状态</label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <select readonly='readonly' name='State_Sel'>
                    <option value='0' {{ d.params.State_Sel == '0' ? 'selected' : '' }}>启用</option>
                    <option value='1' {{ d.params.State_Sel == '1' ? 'selected' : '' }}>停用</option>
                </select>
            </script>
        </div>
    </div>
       
    <div class='layui-form-item'>
        <label class='layui-form-label'>备注</label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='Remark' value='{{ d.params.Remark || '' }}'  placeholder='备注' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>    
    <!--<div class='layui-form-item'>
        <label class='layui-form-label'>所属部门</label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='DepartmentID_SelSourceName' value='{{ d.params.DepartmentID_SelSourceName || '' }}'  placeholder='部门' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   

    <div class='layui-form-item'>
        <label class='layui-form-label'>组织</label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='GroupName' value='{{ d.params.GroupName || '' }}' lay-verify='required' placeholder='组织' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>--> 

    <div class='layui-form-item'>
        <label class='layui-form-label'>邮箱</label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='Email' value='{{ d.params.Email || '' }}' lay-verify='required' placeholder='邮箱' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div> 
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-block">
            <input type="button" onclick="Close()" value="关闭" class="layui-btn">
        </div>
    </div>
</div>

<script type="text/javascript">

    function Close() {
        layer.closeAll();
    }
    
    layui.data.setUpload = function (d) {
        layui.use(['upload', 'admin'], function () {
            var $ = layui.$,
            upload = layui.upload,
            admin = layui.admin;
            var formSelects = layui.formSelects;

            //上传头像
            var Photo_UploadSrc = $('#Photo_Upload');
            upload.render({
                url: '/file/uploadImg/'
              , elem: '#Photo_UploadBtn'
              , accept: 'images'
              , method: 'get'
              , multiple: true
              , acceptMime: 'image/*'
              , done: function (res) {
                  if (res.ResultCode == 0) {
                      Photo_UploadSrc.val(res.Data.src);
                      layer.msg('上传成功');
                  } else {
                      layer.msg(res.msg);
                  }
              }
            });

            //查看图片
            admin.events.Photo_UploadImg = function (othis) {
                var src = Photo_UploadSrc.val();
                layer.photos({
                    photos: {
                        "title": "查看头像" //相册标题
                      , "data": [{
                       "src": src //原图地址
                      }]
                    }
                  , shade: 0.01
                  , closeBtn: 1
                  , anim: 5
                });
            };

        });
    }


    layui.data.datedone = function (d) {
        layui.use('laydate', function () {
            var laydate = layui.laydate;

            //日期时间选择器
            laydate.render({
                elem: '#LastLoginTime'
              , type: 'datetime'
              , calendar: true
            });
            laydate.val = d.LastLoginTime;

        });
    }

    layui.use(['form'], function () {
        var form = layui.form;//required（必填项）phone（手机号）email（邮箱）url（网址）number（数字）date（日期）identity（身份证） 自定义值
    });
</script>
